#!/usr/bin/python
# coding:utf-8
# auther:DT
# 2017-08-13_16-26-21
a = input("请输入一个数")

def add(a):
    sum = 0
    for i in a:
        sum = sum + int(i)

if len(str(sum)) > 2:
    add(sum)

print(sum)
